package com.example.smssender.contactimport;

import com.example.smssender.Contact;
import java.util.ArrayList;
import java.util.List;

/**
 * 导入结果类
 */
public class ImportResult {
    private boolean success;                    // 是否成功
    private List<Contact> contacts;             // 成功导入的联系人
    private List<String> errors;                // 错误信息列表
    private int totalCount;                     // 总记录数
    private int successCount;                   // 成功数量
    private int failCount;                      // 失败数量
    private int duplicateCount;                 // 重复数量（手机号已存在）
    
    public ImportResult() {
        this.contacts = new ArrayList<>();
        this.errors = new ArrayList<>();
        this.success = false;
    }
    
    public boolean isSuccess() {
        return success;
    }
    
    public void setSuccess(boolean success) {
        this.success = success;
    }
    
    public List<Contact> getContacts() {
        return contacts;
    }
    
    public void setContacts(List<Contact> contacts) {
        this.contacts = contacts;
    }
    
    public List<String> getErrors() {
        return errors;
    }
    
    public void setErrors(List<String> errors) {
        this.errors = errors;
    }
    
    public void addError(String error) {
        if (error != null && !error.isEmpty()) {
            this.errors.add(error);
        }
    }
    
    public int getTotalCount() {
        return totalCount;
    }
    
    public void setTotalCount(int totalCount) {
        this.totalCount = totalCount;
    }
    
    public int getSuccessCount() {
        return successCount;
    }
    
    public void setSuccessCount(int successCount) {
        this.successCount = successCount;
    }
    
    public int getFailCount() {
        return failCount;
    }
    
    public void setFailCount(int failCount) {
        this.failCount = failCount;
    }
    
    public int getDuplicateCount() {
        return duplicateCount;
    }
    
    public void setDuplicateCount(int duplicateCount) {
        this.duplicateCount = duplicateCount;
    }
}

